<template>
  <div class="container">
      <!-- <input type="checkbox">  -->
      <div class="Check">
    <el-checkbox label="全选" style="color:black :margin-left:20px"  >全选</el-checkbox>
       <el-button type="text"  style="color:black" @click="delfun">批量删除</el-button>
      </div>
       
        <el-pagination
      @size-change="handleSizeChange"
      background
      @current-change="handleCurrentChange"
       :current-page.sync="currentPage3"
      :page-size="24"
      layout="prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
import {delHomeApi, updelHomeApi} from '../../../api/homeApi'
export default {
    props: ['arr','total', 'ids'],
    data () {
        return {
              currentPage3: 1,    //当前页码
              checkedAll:false,
            //   checkedOther:[]
        }
    },
methods: {
      delfun() {
        var ids = this.ids
         updelHomeApi({ids}).then(res => {
                console.log(res)
                if(res.code == 200) {
                    this.$emit('delfun')
                    // console.log('成功')
                }
            })
      },

      handleSizeChange(val) {
     
        // 每页多少条数据
        // 修改父组件中的pageSize

        this.$parent.pageSize= val
        // 刷新表格
        this.$emit('resetdata')
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        // val要传递给父组件page
        this.$parent.page=val
        //  刷新表格
        this.$emit('resetdata')
      },
    // //   全选函数
    //   checkboxAll(){
    //       if(this.checkedAll){
    //           this.arr.forEach(ele=>{
    //               this.checkedOther.push(ele.id)
    //           })
    //       }else{
    //         //   如果this.checkedALl为flase,则赋值为空数组
    //            this.checkedOther=[]
    //       }
    //   }
    //   batchdel(){

    //   }
    },
}
</script>

<style scoped lang="less">
     .container{
         display: flex;
         justify-content: flex-start;
         padding-bottom: 10px;
         box-sizing: border-box;
         padding-left: 20px;
     }
     .Check{
         margin-right:100px ;
     }
</style>